<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<script type="text/javascript">
	$(function() {
		parent.$.messager.progress('close');
	
		var typeBox = $('#building-typeId').combobox({url:'/buildingType/combobox?residenceId=${door.residenceId}'});
		$('#form').form({
			url : '/houseDoorplatManager/edit',
			onSubmit : function() {
				parent.$.messager.progress({
					title : '提示',
					text : '数据处理中，请稍后....'
				});
				var isValid = $(this).form('validate');
				if (!isValid) {
					parent.$.messager.progress('close');
				}
				return isValid;
			},
			success : function(result) {
				parent.$.messager.progress('close');
				try{
					result = $.parseJSON(result);
					if (result.success) {
						parent.$.modalDialog.openner_datagrid.datagrid('reload');
						parent.$.modalDialog.handler.dialog('close');
					}  else {
						parent.$.messager.alert("提示",result.msg,"info");
					}
				} catch(e){
					parent.$.messager.alert("提示",result,"info");
				}
			}
		});
	});
</script>
<div class="easyui-layout" data-options="fit:true,border:false">
	<div data-options="region:'center',border:false" title="" style="overflow-y:auto;">
		<form id="form" method="post">
			<input name="id" value="${door.id }" type="hidden" />
			<table class="table table-hover table-condensed">
				<tr>
					<th>当前小区</th>
					<td>
					<input name=""  readonly="readonly" style="width:380px" value="${door.residenceName }" />
					</td>
				</tr>
				<tr>
					<th>楼栋</th>
					<td>
					<input  name="buildingName" value="${door.buildingName }" readonly="readonly" style="width:380px"/>
					<input  name="parentId" value="${door.parentId }" readonly="readonly" type="hidden"/>
					</td>
				</tr>
				<tr>
					<th>单元名称</th>
					<td>
					<input  name="buildingUnitName" value="${door.buildingUnitName }" readonly="readonly" style="width:380px"/>
					<input  name="buildingId" value="${door.buildingId}" readonly="readonly" type="hidden""/>
					</td>
				</tr>
				<tr>
					<th>楼栋类型</th>
					<td>
					<input name="typeId" id="building-typeId" type="text" placeholder="楼栋类型" value="${door.typeId }" class="" data-options="required:true,editable:false,width:380,icons:[{
											iconCls:'icon-clear',
											handler: function(e){
												$(e.data.target).combobox('setValue','');
											}
										}]" >
					</td>
				</tr>
				<tr>
					<th>门牌号</th>
					<td>
					<input name="num" type="text" placeholder="门牌号" class="easyui-validatebox span2" style="width:380px" data-options="required:true" value="${door.num }">
					</td>
				</tr>
				<tr>
					<th>业主名称</th>
					<td>
					<input name="ownerName" type="text" placeholder="业主名称" class="easyui-validatebox span2" data-options="" value="${door.ownerName }" style="width:380px">
					</td>
				</tr>
				<tr>
					<th>业主联系方式</th>
					<td>
					<input name="ownerMobile" type="text" placeholder="业主联系方式" style="width:380px" class="easyui-validatebox span2" data-options="" value="${door.ownerMobile}">
					</td>
				</tr>
				<tr>
					<th>入住时间</th>
					<td>
					<input name="useDate" type="text" placeholder="业主联系方式" style="width:380px" class="easyui-datebox span2" data-options="editable:false"  value="${door.useDate }">
					</td>
				</tr>
				<tr>
					<th>建筑面积(平方米)</th>
					<td>
					<input name="space" type="text" placeholder="建筑面积(平方米)" style="width:380px" class="easyui-numberbox" data-options="precision:2,required:true"  value="${door.space }"  >
					</td>
				</tr>
				<tr>
					<th>状态</th>
					<td>
					<input name="status" type="text" placeholder="状态" class="easyui-combobox span2"  value="${door.status }"  data-options="
								editable:false,
								required:true,
								panelHeight:'auto',
								width:380,
								data : [{value:1,text:'自住'},{value:2,text:'出租'},{value:3,text:'其他'}]
								">
					</td>
				</tr>
				<tr>
					<th>描述</th>
					<td>
					<textarea name="comment" style="width:380px">${door.comment }</textarea>
					</td>
				</tr>
			</table>
		</form>
	</div>
</div>